package cn.edu.cqupt.cxcy.action;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Map;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import cn.edu.cqupt.cxcy.dto.TeacImpl;
/**
 * 根据项目状态分类展示项目
 * @author BINGBING
 *
 */
@WebServlet(asyncSupported = true, urlPatterns = { "/ProjectToTeacher" })
public class Teac_ProjectShowToTeacher extends HttpServlet {
	private static final long serialVersionUID = 1L;
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		doPost(request,response);
	}
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		int project_status=Integer.valueOf(request.getParameter("project_status"));
		System.out.println(request.getParameter("project_status"));
		ArrayList<Map<String,Object>> list=new ArrayList<Map<String,Object>>();
		TeacImpl teacDao=new TeacImpl();
		list=teacDao.ProjectShowToTeacher(project_status);
		request.setAttribute("allprj", list);
		//show.jsp为数据传送的页面，待定
		request.getRequestDispatcher("show.jsp").forward(request, response);
	}

}
